#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>

using namespace std;

int removeElement(int* nums, int numsSize, int val)
{
    int dst = 0, src = 0;
    while (src < numsSize)
    {
        if (nums[src] != val)
        {
            nums[dst++] = nums[src];
        }
        src++;
    }
    return dst;
}

int main()
{
    int arr[] = { 3,2,2,3 };
    cout << removeElement(arr, 4, 2) << endl;
    return 0;
}